package com.songcan.oauth.utils;

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.dypnsapi.model.v20170525.GetMobileRequest;
import com.aliyuncs.dypnsapi.model.v20170525.GetMobileResponse;
import com.aliyuncs.exceptions.ClientException;

public class AliyunMobileKeyUtil  {



    public  String login(String token){
        // TODO 通过Token 获取手机号码
        GetMobileRequest mobileRequest = new GetMobileRequest();
        mobileRequest.setAccessToken(token);

        GetMobileResponse response = null;
        try {
            DefaultAcsClient defaultAcsClient = new DefaultAcsClient();
            response = defaultAcsClient.getAcsResponse(mobileRequest);
        } catch (ClientException e) {
            e.printStackTrace();
        }

       return response.getGetMobileResultDTO().getMobile();

    }
}
